package com.bidbid.item.service.impl;

import com.bidbid.item.dao.IItemManager;
import com.bidbid.item.dao.domain.Item;
import com.bidbid.item.service.IItemService;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ItemServiceImpl implements IItemService{
	
	@Autowired
	IItemManager itemManager;

	public IItemManager getItemManager() {
		return itemManager;
	}

	public void setItemManager(IItemManager itemManager) {
		this.itemManager = itemManager;
	}

	@Override
	public List<Item> getAllItems() throws SQLException {
		return itemManager.listItems();
	}

	@Override
	public void AddItem(Item item) throws SQLException {
		itemManager.addItem(item);
	}

	@Override
	public List<Item> getRecommendedItems() throws SQLException {
		return itemManager.getRecommendedItems();
	}

}
